package com.unique.flyme.match.netServiceTools.meizuApi;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

/**
 * Description:
 * User: Dream_Coder(chenchen_839@126.com)
 * Date: 2015-10-25
 * Time: 02:06
 */
public class BaseMeizuSendHelper {
    private volatile static RequestQueue requestQueue = null;
    protected Context context = null;

    public BaseMeizuSendHelper(Context context) {
        this.context = context;
    }

    /**
     * 单例化，防止多个地方网络问题
     * @return
     */
    protected RequestQueue getRequestQueue() {
        if (requestQueue == null) {
            synchronized (this) {
                if (requestQueue == null) {
                    requestQueue = Volley.newRequestQueue(context.getApplicationContext());
                }
            }
        }
        return requestQueue;
    }
}
